package com.practice.tkmybatis;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootTest
@Slf4j
public class RedisStudy {

    @Autowired
    private RedisTemplate redisTemplate;

    @Test
    public void testSpring() {
        // 插入一条string类型数据
        redisTemplate.opsForValue().set("name", "李四");
        // 读取一条string类型数据
        final Object name = redisTemplate.opsForValue().get("name");
        log.info("name:{}", name);
    }
}
